/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 使用px单位，以375px为设计基准 */
html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 顶部工具栏 */
.toolbar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toolbar h1 {
    font-size: 20px;
    color: #333;
}

.toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 页面管理样式 */
.page-manager {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 15px;
}

.page-tabs {
    display: flex;
    gap: 5px;
    max-width: 300px;
    overflow-x: auto;
}

.page-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.3s;
}

.page-tab:hover {
    background: #e9ecef;
}

.page-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.page-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.page-close:hover {
    background: rgba(255,255,255,0.2);
}

.page-tab:not(.active) .page-close:hover {
    background: rgba(0,0,0,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown-toggle {
    background: none;
    border: none;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.user-dropdown-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2d3748;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    color: #4a5568;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f7fafc;
    color: #2d3748;
}

.dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 4px 0;
}

/* 用户管理样式 */
.user-manage-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px 0;
    border-bottom: 2px solid #f1f3f4;
}

.user-search input {
    padding: 12px 16px;
    border: 2px solid #e8eaed;
    border-radius: 8px;
    font-size: 14px;
    width: 240px;
    background: #fafbfc;
    transition: all 0.3s ease;
}

.user-search input:focus {
    outline: none;
    border-color: #4285f4;
    background: white;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.user-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.user-list::-webkit-scrollbar {
    width: 6px;
}

.user-list::-webkit-scrollbar-track {
    background: #f1f3f4;
    border-radius: 3px;
}

.user-list::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

.user-list::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

.user-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    margin-bottom: 12px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.user-item:hover {
    background: #fafbfc;
    border-color: #dadce0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285f4, #34a853);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.user-details h4 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 600;
    color: #202124;
}

.user-details p {
    margin: 0;
    font-size: 13px;
    color: #5f6368;
    font-weight: 400;
}

.user-role {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-role.super_admin {
    background: #e8f0fe;
    color: #1a73e8;
    border: 1px solid #dadce0;
}

.user-role.user {
    background: #f1f3f4;
    color: #5f6368;
    border: 1px solid #e8eaed;
}

.user-actions {
    display: flex;
    gap: 12px;
}

.user-actions button {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 60px;
}

.edit-user-btn {
    background: #f8f9fa;
    color: #5f6368;
    border: 1px solid #dadce0;
}

.edit-user-btn:hover {
    background: #e8eaed;
    color: #202124;
    border-color: #bdc1c6;
}

.delete-user-btn {
    background: #fce8e6;
    color: #d93025;
    border: 1px solid #f28b82;
}

.delete-user-btn:hover {
    background: #fce8e6;
    color: #b52d20;
    border-color: #ea4335;
}

.delete-user-btn:disabled {
    background: #f8f9fa;
    color: #9aa0a6;
    border-color: #dadce0;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 用户管理模态框特殊样式 */
#userManageModal .modal-content {
    max-width: 800px;
    width: 90%;
}

#userManageModal .modal-header {
    background: #f8f9fa;
    border-bottom: 2px solid #e8eaed;
}

#userManageModal .modal-body {
    padding: 24px 32px 32px;
}

/* 用户编辑模态框样式 */
#userEditModal .modal-content {
    max-width: 480px;
    width: 90%;
}

/* z-index控制样式 */
.z-index-controls {
    display: flex;
    gap: 6px;
    margin-top: 5px;
}

.z-index-controls .btn {
    flex: 1;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
    border: 1px solid #e8eaed;
    background: #f8f9fa;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
}

.z-index-controls .btn:hover {
    background: #e8eaed;
    color: #202124;
    border-color: #dadce0;
}

.z-index-controls .btn:active {
    background: #dadce0;
    transform: translateY(1px);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 11px;
    min-height: 28px;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #117a8b;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* 主内容区域 */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧边栏 */
.sidebar {
    width: 250px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;
    position: relative;
    z-index: 100;
}

.sidebar h3 {
    color: #333;
    font-size: 16px;
}

.element-categories {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.element-categories.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.category h4 {
    margin-bottom: 8px;
    color: #666;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 4px 0;
    border-bottom: 1px solid #f0f0f0;
}

.element-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: grab;
    transition: all 0.2s;
    margin-bottom: 8px;
    text-align: center;
    min-height: 60px;
    justify-content: center;
}

.element-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.element-item:active {
    cursor: grabbing;
}

.element-icon {
    font-size: 20px;
}

.element-item span:last-child {
    font-size: 11px;
    color: #333;
    font-weight: 500;
}

/* 画布区域 */
.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    margin: 0 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.canvas-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.canvas-header h3 {
    margin: 0;
    color: #333;
    font-size: 16px;
}

.canvas-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.canvas-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.page-navigation {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 20px;
    border: 1px solid #dee2e6;
}

.page-nav-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.page-nav-btn:hover:not(:disabled) {
    background: #0056b3;
}

.page-nav-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

#pageIndicator {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

/* Canvas Swiper样式 */
.canvasSwiper {
    width: 375px;
    height: 667px;
}

.canvasSwiper .swiper-wrapper {
    height: 667px;
}

.canvasSwiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas {
    position: relative;
    background: #fff;
    width: 375px;
    height: 667px;
    border: 2px dashed #ddd;
    margin: 0 auto;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

/* 翻页效果 */
.canvas.slide-transition {
    transition: transform 0.3s ease;
}

.canvas.fade-transition {
    transition: opacity 0.3s ease;
}

.canvas-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #999;
    font-size: 16px;
}

.canvas.drag-over {
    border-color: #007bff;
    background-color: #f0f8ff;
}

/* 画布中的元素 */
.canvas-element {
    position: absolute !important;
    border: 2px solid transparent;
    cursor: move;
    min-width: 50px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* padding: 5px; */
    word-wrap: break-word;
    z-index: 1;
}

.canvas-element:hover {
    border-color: #007bff;
}

.canvas-element.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.canvas-element .resize-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #007bff;
    border: 1px solid #fff;
    border-radius: 50%;
}

.canvas-element .resize-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.canvas-element .resize-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.canvas-element .resize-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.canvas-element .resize-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }

/* Tab切换样式 */
.properties-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #333;
}

.tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: #fff;
}

.tab-content {
    display: none;
    padding: 15px;
}

.tab-content.active {
    display: block;
}

/* 右侧属性面板 - 上中下三结构 */
.properties-panel {
    width: 480px;
    background: #fff;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 上：标题固定 */
.properties-panel h3 {
    margin: 0;
    padding: 15px;
    color: #333;
    font-size: 15px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    height: auto;
}

/* 中：内容滚动 */
.properties-content {
    flex: 1;
    padding: 5px;
    overflow-y: auto;
    min-height: 0;
}

/* 删除按钮与属性设置同级 */
.properties-content #deleteElement {
    margin-top: 20px;
    width: 100%;
}


.placeholder {
    color: #999;
    text-align: center;
    font-style: italic;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* 双排布局中的form-group样式 */
.properties-content .form-group {
    margin-bottom: 10px;
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
}

/* 某些属性需要跨列显示 */
.form-group.full-width {
    grid-column: 1 / -1;
}

/* 颜色输入组样式 */
.color-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-input-group input[type="color"] {
    width: 40px;
    height: 32px;
    padding: 0;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
}

.color-value {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 6px;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
    min-width: 60px;
    text-align: center;
}

.form-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    margin-bottom: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    background: #ffffff;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fafbfc;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: #cbd5e0;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    text-decoration: none;
    font-family: inherit;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-danger {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c53030, #9c2626);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(229, 62, 62, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #a0aec0, #718096);
    color: white;
    box-shadow: 0 4px 12px rgba(160, 174, 192, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #718096, #4a5568);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(160, 174, 192, 0.4);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    margin: 8% auto;
    padding: 0;
    border-radius: 16px;
    width: 420px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.2);
    border: 1px solid #e8eaed;
    animation: modalSlideIn 0.3s ease-out;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 28px 32px 24px;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: #202124;
    font-size: 20px;
    font-weight: 600;
}

.close {
    color: #5f6368;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    background: transparent;
    border: none;
}

.close:hover {
    color: #202124;
    background: #e8eaed;
    transform: scale(1.05);
}

.modal-body {
    padding: 32px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .toolbar {
        padding: 0 10px;
        height: 50px;
    }
    
    .toolbar h1 {
        font-size: 16px;
    }
    
    .toolbar-right {
        gap: 5px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .user-info {
        margin-left: 8px;
        padding-left: 8px;
    }

    .user-dropdown-toggle {
        font-size: 13px;
        padding: 4px 8px;
    }

    .user-dropdown-menu {
        min-width: 140px;
        right: -10px;
    }

    .dropdown-item {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar,
    .properties-panel {
        width: 100%;
        height: auto;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .properties-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .canvas-container {
        margin: 10px;
        min-height: 60vh;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .canvas {
        width: 375px;
        height: 667px;
        min-height: 667px;
        transform: scale(0.8);
        transform-origin: top center;
    }
    
    .element-item {
        padding: 8px;
        font-size: 14px;
    }
    
    .modal-content {
        width: 90%;
        margin: 10% auto;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 20px 24px 16px;
    }
    
    .modal-body {
        padding: 24px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 12px;
        min-height: 34px;
    }
}

@media (max-width: 480px) {
    .toolbar {
        padding: 0 5px;
        height: 45px;
    }
    
    .toolbar h1 {
        font-size: 14px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 11px;
        min-height: 32px;
    }
    
    .sidebar,
    .properties-panel {
        max-height: 150px;
        padding: 10px;
    }
    
    .canvas-container {
        margin: 5px;
        min-height: 50vh;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .canvas {
        width: 375px;
        height: 667px;
        min-height: 667px;
        transform: scale(0.6);
        transform-origin: top center;
    }
    
    .element-item {
        padding: 6px;
        font-size: 12px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        border-radius: 10px;
    }
    
    .modal-header {
        padding: 16px 20px 12px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 12px;
        min-height: 32px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .canvas-element {
        min-width: 60px;
        min-height: 40px;
    }
    
    .resize-handle {
        width: 12px;
        height: 12px;
    }
    
    .element-item:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Toast提示样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(100%);
    opacity: 0;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Toast类型样式 */
.toast.success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.toast.error {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.toast.warning {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.toast.info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
}

/* 进度条动画 */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    animation: toast-progress 3s linear forwards;
}

@keyframes toast-progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .sidebar {
        width: 200px;
    }
    .properties-panel {
        width: 250px;
    }
}

/* 手风琴样式 */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.accordion-header:hover {
    color: #007bff;
}

.accordion-icon {
    font-size: 12px;
    transition: transform 0.2s;
}

.accordion-header.collapsed .accordion-icon {
    transform: rotate(-90deg);
}

.accordion-content {
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-content.collapsed {
    max-height: 0;
    padding: 0;
    margin: 0;
}

.accordion-content:not(.collapsed) {
    max-height: 1000px;
    padding: 10px 0;
}

/* 结构库样式 */
.structure-library {
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.structure-library h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.structure-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.structure-item:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.structure-item:active {
    background: #dee2e6;
    transform: translateY(0);
}

.structure-item.active {
    background: #007bff;
    color: white;
    border-color: #0056b3;
}

.structure-item.active .structure-icon,
.structure-item.active span:last-child {
    color: white;
}

.structure-icon {
    font-size: 18px;
    margin-right: 8px;
}

.structure-item span:last-child {
    font-size: 13px;
    color: #333;
}

/* 结构库气泡提示 */
.structure-tooltip {
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px;
    min-width: 200px;
    z-index: 9999;
    display: none;
}

.structure-tooltip.show {
    display: block;
}

.tooltip-header {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
}

.grid-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.grid-option {
    flex: 1;
    text-align: center;
    cursor: pointer;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.2s;
}

.grid-option:hover {
    background: #f0f0f0;
}

.grid-option.selected {
    border-color: #007bff;
    background: #e3f2fd;
}

.grid-preview {
    display: grid;
    gap: 2px;
    margin-bottom: 5px;
    height: 20px;
}

.grid-option[data-cols="2"] .grid-preview {
    grid-template-columns: 1fr 1fr;
}

.grid-option[data-cols="3"] .grid-preview {
    grid-template-columns: 1fr 1fr 1fr;
}

.grid-option[data-cols="4"] .grid-preview {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.preview-cell {
    background: #007bff;
    border-radius: 2px;
}

.grid-option span {
    font-size: 11px;
    color: #666;
}

.tooltip-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-cancel, .btn-confirm {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.btn-cancel:hover {
    background: #e9ecef;
}

.btn-confirm {
    background: #007bff;
    color: white;
}

.btn-confirm:hover {
    background: #0056b3;
}

/* 全宽网格样式 */
.full-width-grid {
    width: 100% !important;
    max-width: 375px !important;
    margin: 0 auto;
}
